﻿using System;
using System.Activities;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using WFExtended.Framework.DurableInstancing;
using WFExtended.Samples.Activities;
using WFExtended.Samples.ServiceModel;

namespace WFExtended.Samples.ConsoleRun
{
    public class WcfContractProxyTest : AConsoleRun
    {
        public override void Execute()
        {
            using (ServiceHttpHost<MyService> host = new ServiceHttpHost<MyService>())
            {
                using (System.ServiceModel.ServiceHost host2 = new System.ServiceModel.ServiceHost(typeof(MyService2)))
                {
                    host2.Open();

                    WorkflowApplication instance = new WorkflowApplication(new WcfContractProxy())
                    {
                        PersistableIdle = (e) => PersistableIdleAction.Persist

                    };
                    instance.InstanceStore = new XmlInstanceStore(instance.Id);
                    instance.Run();

                    Console.WriteLine("Enter to Exit");
                    Console.ReadLine();
                }
            }

        }
    }
}
